import { ajax } from '../http.js';

const scanTicketUrl = '/authc/hot_sale/ticket/scan_ticket'; // 扫码核销码获取信息
const ticketConfirmUrl = '/authc/hot_sale/ticket/confirm'; // 确认核销
const findStorePageUrl = '/authc/hot_sale/ticket/find_store_ticket'; // 爆品核销
const ticketByStoreUrl = '/authc/hot_sale/ticket/count_ticket_by_storeId'; // 核销码数量及金额统计
const myHotProductUrl = '/authc/hot_sale/product/find_my_hot_product'; // 获取爆品名称

const scanTicket = (data, success, fail) => // 查询推荐人数比例
  ajax({
    apiUrl: '/hotapi',
    url: scanTicketUrl,
    data: data,
    success: success,
    fail: fail
  });

const ticketConfirm = (data, success, fail) => // 确认核销
  ajax({
    apiUrl: '/hotapi',
    url: ticketConfirmUrl,
    data: data,
    success: success,
    fail: fail
  });

const findStorePage = (data, success, fail) => // 爆品核销
  ajax({
    apiUrl: '/hotapi',
    url: findStorePageUrl,
    data: data,
    success: success,
    fail: fail
  });

const ticketByStore = (data, success, fail) => // 核销码数量及金额统计
  ajax({
    apiUrl: '/hotapi',
    url: ticketByStoreUrl,
    data: data,
    success: success,
    fail: fail
  });

const myHotProduct = (data, success, fail) => // 核销码数量及金额统计
  ajax({
    apiUrl: '/hotapi',
    url: myHotProductUrl,
    data: data,
    success: success,
    fail: fail
  });
export {
  scanTicket,
  ticketConfirm,
  findStorePage,
  ticketByStore,
  myHotProduct
}